#include "StdAfx.h"
#include "Singleton.h"


template <class T>
auto_ptr<T> Singleton<T>::_instance;
 
template <class T>
 inline T* Singleton<T>::instance()
{
       if( 0== _instance.get())
       {
              _instance.reset ( new T);
       }
      
       return _instance.get();
}
 
//Class that will implement the singleton mode,
//must use the macro in it's delare file
#define DECLARE_SINGLETON_CLASS( type ) \
       friend class auto_ptr< type >;\
       friend class Singleton< type >;

